﻿using System;
using System.ServiceModel;
using System.ServiceModel.Channels;
using XchangeStreamer.Core.Retriever;

namespace XchangeStreamer.Subscriber.SDK
{
    internal sealed class Retriever : ClientBase<IRetriever>, IRetriever
    {
        #region Public Const.

        public Retriever(Binding binding, EndpointAddress remoteAddress)
            : base(binding, remoteAddress)
        {
        }

        #endregion

        #region IRetriever Members

        public IAsyncResult BeginRetrieve(int clientMessageId, int serverMessageId, int[] topicsId, AsyncCallback callback, object state)
        {
            return this.Channel.BeginRetrieve(clientMessageId, serverMessageId, topicsId, callback, state);
        }

        public void EndRetrieve(IAsyncResult result)
        {
            this.Channel.EndRetrieve(result);
        }

        #endregion
    }
}